package com.loong.data.model;

import lombok.*;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Description:
 * @Author: hzp
 * @Date: 2021-1-2 22:10
 */
@Setter
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(indexName = "order", type = "order", replicas = 0)
public class OrderModel {
    private Long id;
    private Long shopId;

    /**
     * 订单号
     */
    private String orderNumber;

    /**
     * 下单时间
     */
    private Date createOrderTime;

    /**
     * 期望送达时间
     */
    private Date expectTime;

    /**
     * 总价(sku总价)
     */
    private BigDecimal totalPrice;

    /**
     * 订单状态
     */
    private Integer status;

    /**
     * 配送费
     */
    private BigDecimal postFee;

    /**
     * 优惠金额
     */
    private BigDecimal discountPrice;

    /**
     * 实付金额
     */
    private BigDecimal payment;

    /**
     * 支付类型
     */
    private String paymentType;

    /**
     * 付款时间
     */
    private Date paymentTime;

    /**
     * 发货时间
     */
    private Date deliveryTime;

    /**
     * 交易完成时间
     */
    private Date endTime;

    /**
     * 交易结束时间
     */
    private Date closeTime;

    /**
     * 买家id
     */
    private Long userId;

    /**
     * 买家昵称
     */
    private String userNick;

    /**
     * 买家是否评论
     */
    private Boolean commentFlag;

    /**
     * 买家是否自取
     */
    private Boolean inviteFlag;

    /**
     * 自取时间
     */
    private Date inviteTime;

    /**
     * 订单备注
     */
    private String orderRemark;

    /**
     * 取消原因  user selected  是表维护？
     */

    /**
     * 订单详情
     */
    @Field(type = FieldType.Nested)
    private List<OrderItemsModel> orderItemList;

    /**
     * 配送信息
     */
    @Field(type = FieldType.Object)
    private OrderDeliveryModel orderDelivery;
}
